//
//  MJImageCache.h
//  MJ_ImageCache
//
//  Created by apple on 16/5/14.
//  Copyright © 2016年 apple. All rights reserved.
//

#import <Foundation/Foundation.h>
@import UIKit;

@interface MJImageCache : NSObject

+ (instancetype)shareImageCache;

#pragma mark - Insert
- (void)insertImageToCache:(UIImage *)image
                 imageData:(NSData *)imageData
                    forkey:(NSString *)key
                    toDisk:(BOOL)toDisk;

- (void)insertImageOnlyToCache:(UIImage *)image
                     imageData:(NSData *)imageData
                        forKey:(NSString *)key;

- (void)setCachetotalCostLimit:(NSUInteger)totalCostLimit;

- (void)setCacheCountLimit:(NSUInteger)countLimit;

#pragma mark - Delete
- (void)removeImageFromCacheWithkey:(NSString *)key;

- (void)removeAllCache;


#pragma mark - Select
- (UIImage *)getImageFromCacheWithKey:(NSString *)key;

- (UIImage *)getImageWithURL:(NSString *)url;


@end
